package Event;

public class Client {

	public static void main(String[] args) {
		EventAdapter adapter = new EventAdapter();
		adapter.setActionEvent(new AbstractActionEvent() {
			@Override
			public void onClick(EventSource e) {
				System.out.println(String.format("单击事件，事件源:%s", e.getName()));
			}
			
		});
		
		adapter.setActionEvent(new AbstractActionEvent() {
			@Override
			public void onDoubleClick(EventSource e) {
				System.out.println(String.format("双击事件，事件源:%s", e.getName()));
			}
			
		});
		
		adapter.notifyEvent(new EventSource("键盘"));
		adapter.notifyEvent(new EventSource("鼠标"));
	}
}
